<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<title><%= casein_generate_page_title %></title>
        <link rel="icon" type="image/png" href="<%= casein_config_favicon %>" />
		<% casein_config_stylesheet_includes.each do |stylesheet| %>
			<%= stylesheet_link_tag(stylesheet) %>
		<% end %>
		
		<% casein_config_javascript_includes.each do |javascript| %>
			<%= javascript_include_tag(javascript) %>
		<% end %>

		<%= csrf_meta_tag %>
		<script src="http://code.jquery.com/jquery-latest.js"></script>
		<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
		<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
		<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
		
		<!--script type="text/javascript">
			$(function() {
			  if ($.browser.msie && $.browser.version.substr(0,1)<7)
			  {
				$('li').has('ul').mouseover(function(){
					$(this).children('ul').css('visibility','visible');
					}).mouseout(function(){
					$(this).children('ul').css('visibility','hidden');
					})
			  }
			}); 
		</script-->
		<script type="text/javascript">
		 $(function() {
			var tabs = $( "#tabs" ).tabs();
			tabs.find( ".ui-tabs-nav" ).sortable({
				axis: "x",
				stop: function() {
					tabs.tabs( "refresh" );
				}
			});
		});
		</script>
    </head>
	<body>
		<div id="header">
			
			<h1><%= link_to(image_tag(casein_config_logo, :alt => casein_config_website_name, :size => "50x50"), :controller => :casein) %>
            <div class="website_name"><%= Param.get_param_value("website_name") %></div>
            </h1>
			<div id="dashboard">
				<% if @session_user != nil %>
				<ul>
					<li>Chào <%= @session_user.name %>!</li>
					<li>Múi giờ: <%= Time.zone.name %></li>
					<li><%= link_to 'Hồ sơ', casein_user_path(@session_user) %></li>
					<li class="lastItem"><%= link_to 'Đăng xuất', casein_user_session_path, :method => :delete %></li>
				</ul>	
				<% end %>
			</div>
			<div class="top_menu">
				<ul id="menu">
					<%= render :partial => '/casein/layouts/left_navigation' %>	
				</ul>
			</div>
		</div>
		<div id="rightBar">
			<div class="spacer"></div>
			<ul>
				<%= yield :sidebar %>
			</ul>
		</div>
		<div id="content">
			<div id="data">
				<% if flash[:warning] %>
					<div id="error">
						<%= flash[:warning] %>
					</div>
				<% end %>
				<% if flash[:notice] %>
					<div id="notice">
						<%= flash[:notice] %>
					</div>
				<% end %>
				<%= yield %>
				
			</div>
		</div>
	</body>
</html>